﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Southridge.Controls"
    >

	<!--
  *****************************************************************************
  RATINGSCONTROL
  *****************************************************************************
  -->

	<LinearGradientBrush x:Key="Brush_StarFill" StartPoint="0,0" EndPoint="0,1">
		<!--<GradientStop Color="#FFCF3C" Offset="0"/>
    <GradientStop Color="#FFA901" Offset="1"/>-->
		<GradientStop Color="#66AEEF" Offset="0"/>
		<GradientStop Color="#2B6AB3" Offset="1"/>
	</LinearGradientBrush>

	<DropShadowEffect x:Key="Effect_StarDropShadow" BlurRadius="1.5" ShadowDepth=".5" Direction="-90" Opacity="0.5" />

	<Style TargetType="{x:Type local:RatingsControl}">
		<Setter Property="Cursor" Value="Hand" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:RatingsControl}">
					<ListBox x:Name="PART_StarListBoxtName" ItemTemplate="{TemplateBinding StarTemplate}">
						<ListBox.Template>
							<ControlTemplate TargetType="ListBox">
								<StackPanel Orientation="Horizontal" IsItemsHost="True" />
							</ControlTemplate>
						</ListBox.Template>
						<ListBox.ItemContainerStyle>
							<Style TargetType="ListBoxItem">
								<Setter Property="Template">
									<Setter.Value>
										<ControlTemplate TargetType="ListBoxItem">
											<Border x:Name="b" Background="Transparent">
												<ContentPresenter Margin="0,0,2,0 " />
											</Border>
										</ControlTemplate>
									</Setter.Value>
								</Setter>
							</Style>
						</ListBox.ItemContainerStyle>
					</ListBox>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="StarTemplate">
			<Setter.Value>
				<DataTemplate>
					<Path x:Name="Star" Width="13" Height="12" Stretch="Fill" StrokeThickness="0.75" Data="F1 M 1204.88,223.187L 1208.22,229.958L 1215.7,231.044L 1210.29,236.314L 1211.56,243.756L 1204.88,240.242L 1198.2,243.756L 1199.47,236.314L 1194.07,231.044L 1201.54,229.958L 1204.88,223.187 Z ">
						<Path.Stroke>
							<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
								<GradientStop Color="#888" Offset="0.15" />
								<GradientStop Color="#CCC" Offset="1" />
							</LinearGradientBrush>
						</Path.Stroke>
						<Path.Fill>
							<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
								<GradientStop Color="#CCC" Offset="0" />
								<GradientStop Color="#FFF" Offset="1" />
							</LinearGradientBrush>
						</Path.Fill>
					</Path>
					<DataTemplate.Triggers>
						<DataTrigger Binding="{Binding State}" Value="Selected">
							<Setter TargetName="Star" Property="Fill" Value="{StaticResource Brush_StarFill}" />
							<Setter TargetName="Star" Property="StrokeThickness" Value="0" />
							<Setter TargetName="Star" Property="Effect" Value="{StaticResource Effect_StarDropShadow}" />
						</DataTrigger>
					</DataTemplate.Triggers>
				</DataTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>